<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>兄弟连OA项目----学员信息注册</title>

    <link href="css/style.css" rel="stylesheet">
    <link href="css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin" method="post">
        {{ csrf_field() }}
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">学员信息注册</h1>
            <img src="images/login-logo.png" alt=""/>
        </div>

        <div class="login-wrap">
            <select name="class_id" class="form-control mb-15">
                <option>请选择班级</option>
            </select>
            <input name="username" type="text" autofocus="" placeholder="姓名" class="form-control">
            <input name="passwd" type="password" autofocus="" placeholder="密码" class="form-control">
            <input name="passwd_confirmation" type="password" autofocus="" placeholder="确认密码" class="form-control">
            <div class="radios">
                <label for="radio-01" class="label_radio col-lg-6 col-sm-6">
                    <input type="radio" checked="" value="1" id="radio-01" name="sex"> 男
                </label>
                <label for="radio-02" class="label_radio col-lg-6 col-sm-6">
                    <input type="radio" value="0" id="radio-02" name="sex"> 女
                </label>
            </div>

            <p>请选择您的性别</p>
            <input name="card" type="text" autofocus="" placeholder="身份证号" class="form-control">
            <input name="address" type="text" placeholder="籍贯" class="form-control">
            <select class="form-control mb-15" name="source">
                <option value="1">请选择</option>
                <option value="1">百度</option>
                <option value="2">EDM</option>
                <option value="3">学生大本营</option>
                <option value="4">CSDN社区</option>
                <option value="5">程序员杂志</option>
                <option value="6">朋友介绍</option>
                <option value="7">视频教程</option>
                <option value="8">细说PHP</option>
                <option value="9">LAMP兄弟连论坛</option>
                <option value="10">老学员介绍</option>
                <option value="11">google</option>
                <option value="12">其他</option>
            </select>
            <input name="phone" type="text" autofocus="" placeholder="联系手机" class="form-control">
            <input name="qq" type="text" autofocus="" placeholder="QQ" class="form-control">
            <input name="email" type="text" autofocus="" placeholder="E-mail" class="form-control">
            <input name="school" type="text" autofocus="" placeholder="毕业学校" class="form-control">
            <input name="school_address" type="text" autofocus="" placeholder="毕业学校所在省" class="form-control">
            <select name="degree" class="form-control mb-15">
                <option value="1">请选择</option>
                <option value="1">初中</option>
                <option value="2">高中</option>
                <option value="3">中专</option>
                <option value="4">大专</option>
                <option value="5">本科</option>
                <option value="6">本科以上</option>
            </select>
            <input name="subject" type="text" autofocus="" placeholder="专业" class="form-control">
            <select name="basic_computer" class="form-control mb-15">
                <option value="1">计算机基础</option>
                <option value="1">零基础,除了打字上网，别的都不会</option>
                <option value="2">有一些基础，会用Office等常用软件</option>
                <option value="3">计算机基础不错，但与编程无关</option>
                <option value="4">学过其它编程语言，或了解html、mysql</option>
                <option value="5">有php、mysql基础</option>
                <option value="6">php基础不错，或有php相关工作经历</option>
            </select>
            <select name="basic_computer_score" class="form-control mb-15">
                <option value="1">计算机基础评分</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
            </select>
            <input name="work_year" type="text" autofocus="" placeholder="工作经验" class="form-control">
            <select name="target" class="form-control mb-15">
                <option value="1">目标月薪</option>
                <option value="1">3000</option>
                <option value="2">3000-4000</option>
                <option value="3">4000-5000</option>
                <option value="4">5000-6000</option>
                <option value="5">6000-7000</option>
                <option value="6">7000以上</option>
            </select>
            <input name="contacts_name" type="text" autofocus="" placeholder="紧急联系人姓名" class="form-control">
            <input name="contacts_relation" type="text" autofocus="" placeholder="与紧急联系人关系" class="form-control">
            <input name="contacts_phone" type="text" autofocus="" placeholder="紧急联系人电话" class="form-control">
            <label class="checkbox">
                <input class="protocol" type="checkbox" value="1"> 我同意兄弟连的学员手册！
            </label>
            <button type="submit" class="btn btn-lg btn-login btn-block reg">
                <i class="fa fa-check"></i>
            </button>

            <div class="registration">
                已有帐号？
                <a href="{{url('login')}}" class="">
                    登录
                </a>
            </div>

        </div>

    </form>

</div>


<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/modernizr.min.js"></script>
<script>
    $('.reg').click(function () {
        if($(".protocol[type='checkbox']:checked").val() != 1)
        {
            alert('请同意兄弟连学员手册后再注册！');
            return false;
        }
        $.ajax({
            type: "POST",
            url: "{{ url('register') }}",
            data: $('form').serialize(),
            success: function (data) {
            },
            error: function (msg) {
                var data = msg.responseJSON;
                $('.error-title').remove();
                //根据错误提示，在对应的位置创建错误提示！
                for(var v in data)
                {
//                    console.log($("input[name='"+v+"']"));
                    $("input[name='"+v+"']").after('<span class="error-title">'+data[v][0]+'</span>');
                }
            }
        });
        return false;
    });
</script>
</body>
</html>
